package components
{
	import UIFree.controls.uif_cross;
	import UIFree.uif_component;
	
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.Rectangle;
	
	public class c_closeButton extends uif_cross {
		public function c_closeButton(parent: c_window) {
			var outer: Rectangle = parent.title.getOuter();
			var size: Number = outer.height;
			super(parent, outer.right - size, outer.top, size, size, 'closeButton');
			this.addEventListener(MouseEvent.CLICK, function(e: MouseEvent): void {
				parent.dispatchEvent(new Event(Event.CLOSE));
			});
		}
	}
}